/**
 * 顶部导航栏
 * @author heke
 * @version 20170426
 */
const state = {
    menus: [
        {
            type: 'dropdown', // dropdown | default | checkbox
            name: 'New',
            title: 'new form',
            icon: 'fa fa-fw fa-file-o',
            extraCls: '',
            subMenus: [
                {
                    type: 'default',
                    name: 'Standard',
                    title: 'new standard form',
                    icon: 'fa fa-fw fa-file-text-o',
                    extraCls: '',
                    callback: ['newStandardForm']
                }
            ]
        },
        {
            type: 'default',
            name: 'test',
            title: 'test',
            icon: 'fa fa-fw fa-file-o',
            extraCls: '',
            callback: ['showLoading']
        }
    ]
}

const getters = {
    navbarMenus: state => state.menus
}

const actions = {
    newStandardForm ({ commit }) {
        commit('NEW_STANDARD_FORM')
    }
}

const mutations = {
    'NEW_STANDARD_FORM' () {
        console.log('123')
    }
}

export default {
    state,
    getters,
    actions,
    mutations
}
